<section class="content-header">
	<h1>
	  基本信息
    <small>用户管理</small>
  </h1>
	<ol class="breadcrumb">
		<li class="active"><i class="fa fa-dashboard"></i> 用户列表</li>
	</ol>
</section>

<section class="content">
	<div class="box">
		<div class="box-header">
	      <h3 class="box-title">&nbsp;</h3>
	      	<div class="x-search-box">
                <form ng-submit="search(searchWord)">
	      			<div class="input-group input-group-sm" style="width: 700px;" >
		                <div class="input-group-btn">
		                  <button type="button" class="btn btn-success">
		                  	<label>用户名/账号</label>
		                  </button>
		                </div>
	                	<input type="text" ng-model="searchWord" class="form-control" placeholder="用户名/账号" style="width: 600px;" autofocus="autofocus">
		                <span class="input-group-btn" style="display: inline-block;">
		                     <button type="submit" class="btn btn-success btn-flat"><i class="fa fa-fw fa-search"></i></button>
		                </span>
	                </div>
                </form>
	        </div>
	      <div class="box-tools" style = "margin-top: 28px;">
	      	<a href="#/people/add" class="btn btn-primary btn-sm">新增用户</a>
	      </div>
	    </div>
		<!-- /.box-header -->
		<div class="box-body table-responsive no-padding">
			<table class="table table-hover table-striped">
				<tr>
					<th>用户名</th>
					<th>账号</th>
					<th>注册时间</th>
					<th>角色</th>
					<th>分组</th>
					<th>最后登录IP</th>
					<th>最后登录时间</th>
					<th>操作</th>
				</tr>
				<tr ng-repeat="p in pv.datas">
					<td>
						{{p.nickname}}
					</td>
					<td>{{p.loginname}}</td>
					<td>{{p.createTime}}</td>
					<td>
						<button class="btn btn-success btn-xs" 
			          		ng-show="p.role=='ADMIN'" ng-click="changePeopleRole(p, 'USER', '确定要取消管理员吗？')">
			          		管理员
			          	</button> 
			          	<button class="btn btn-default btn-xs" 
			          		ng-show="p.role=='USER'" ng-click="changePeopleRole(p, 'ADMIN', '确定要设置管理员吗？')">
			          		普通用户
			          	</button> 
					</td>
					<td>
						{{p.group}}
					</td>
					<td>
						{{p.lastLoginIp}}
					</td>
					<td>{{p.lastLoginTime}}</td>
					<td>
						<a href="#/people/edit/{{p.id}}" class="btn btn-link btn-xs" data-toggle="modal" data-target="#loginCodeModal">修改</a>
					</td>
				</tr>
			</table>
			<div ng-show="pv.datas.length==0" class="text-center">
				<p>
					<br/>无数据</p>
			</div>
		</div>
		<!-- /.box-body -->
		<div class="box-footer clearfix text-right">
			<page pageview="pv" count="3" before="'#' + pageUrl + ''"></page>
		</div>
	</div>
	<!-- /.box -->
</section>
